package com.wen.open.springframework.beans.factory.config;

import com.wen.open.springframework.beans.factory.HierarchicalBeanFactory;
import com.wen.open.springframework.util.StringValueResolver;

/**
 * 可获取 BeanPostProcessor、BeanClassLoader 等的一个配置化接口
 * @author Wen
 * @date 2023/4/24 08:54
 */
public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, SingletonBeanRegistry{
    String SCOPE_SINGLETON = "singleton";

    String SCOPE_PROTOTYPE = "prototype";

    void addBeanPostProcessor(BeanPostProcessor beanPostProcessor);

    void destroySingletons();

    /**
     * 解析占位符类
     * @param valueResolver
     */
    void addEmbeddedValueResolver(StringValueResolver valueResolver);

    /**
     * 替换占位符
     * @param value
     * @return
     */
    String resolveEmbeddedValue(String value);

}
